package cn.tedu.kcircle.category.front.adapter.rpc;

import cn.tedu.kcircle.category.front.adapter.converter.CategoryConverter;
import cn.tedu.kcircle.category.front.api.rpc.CategoryFrontRpcApi;
import cn.tedu.kcircle.category.front.api.rpc.po.CategoryStandardPO;
import cn.tedu.kcircle.category.front.repository.persist.CategoryRepository;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
public class CategoryFrontRpcApiImpl implements CategoryFrontRpcApi {
    private CategoryRepository categoryRepository;
    private CategoryConverter converter;
    @Override
    public CategoryStandardPO getCategoryById(Long id) {
        return converter.bo2PO(categoryRepository.selectCategoryById(id));
    }
}
